package vipcard.meichehui.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import vipcard.meichehui.domain.Card;
import vipcard.meichehui.domain.CardAdd;
import vipcard.meichehui.domain.User;
import vipcard.meichehui.domain.VipVo;

import java.util.List;

//登录查询
@Mapper

@Component
public interface CardMapper extends BaseMapper<User> {

    @Select("select username,password from sys_wg where username=#{username} and password=#{password}")
    String login(@Param("username") String username, @Param("password") String password);


    @Select("select * from sys_wg where carnumber=#{carnumber}")
   User biand(String carnumber);

    @Insert("INSERT INTO sys_wg (id, carnumber, username,password,stutas,type)  VALUES (#{id}, #{carnumber}, #{username},#{password},#{stutas},#{type})")
   Integer adduser(@Param("id")String id,@Param("carnumber") String carnumber,@Param("username") String username,@Param("password") String password,@Param("stutas")Integer stutas,
                   @Param("type")String type);


    @Select("select * from sys_wg where username=#{username}")
    List<User> findall(String username);


    @Select("select id from sys_vip where nickname=#{nickname}")
   Integer selectid(@Param("nickname") String nickname);

    @Select("select remarks,status_date from card_roll where uid=#{uid}")
    CardAdd selectbyphonea(@Param("uid") String uid);
}
